package com.movitech.mobile.cz.base.common.util;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 
 * @author Jack.Gong
 * @version 2018-02-11
 *
 */
public class CommonConstants {

	//用户并发多线程
	public static ExecutorService cachedThreadPool = Executors.newCachedThreadPool();

	///缓存提交的放重复uuidtoken
    public static Map<String,String> MAP_DUPLICATE_FILTER_DATA = new HashMap<String,String>();

	//0：否，1：是
	public static final int NO_INTEGER = 0;//否
	public static final int YES_INTEGER = 1;//是

	//0：否，1：是
	public static final int SUPPLIER_SOURCE_TYPE_INIT = 1;
	public static final int SUPPLIER_SOURCE_TYPE_IMPORT = 2;


	//是否可登录 1 启用 0停用
	public static final String NO_LOGIN = "0";//否
	public static final String YES_LOGIN = "1";//是
	
	public static final String FAIL = "2";//失败
	public static final String SUCCESS = "1";//成功

	public static final String PICCODE = "MG_AUTHMANAGE_RECRUITMENT:PICCODE";//图片验证码
	public static final String SMSCODE = "MG_AUTHMANAGE_RECRUITMENT:SMSCODE";//短信验证码

	//返回信息配置
	public static final String[] ERROR_CODES = {CommonConstants.ERROR_CODE_FAIL, CommonConstants.ERROR_CODE_EXCEPTION,
				CommonConstants.ERROR_CODE_DATA_NOT_EXISTEN, CommonConstants.ERROR_CODE_DATA_REQUEST,
				CommonConstants.ERROR_CODE_DATA_EMPTY, CommonConstants.ERROR_CODE_TEMPLATE_CATEGEORY_NOT_EXIST,
				CommonConstants.ERROR_CODE_DELETE_EXISTS_RELATED_DATA, CommonConstants.ERROR_CODE_REFUSE_SUPPLIER_IMPORT,
				CommonConstants.ERROR_CODE_FAIL_INTETION_COMPANY_IMPORT, CommonConstants.ERROR_CODE_UPDATE_RECORD_FAIL};
	public static final String[] ERROR_DESCS = {CommonConstants.ERROR_DESC_FAIL, CommonConstants.ERROR_DESC_FAIL,
				CommonConstants.ERROR_DESC_DATA_NOT_EXISTEN, CommonConstants.ERROR_DESC_DATA_REQUEST,
				CommonConstants.ERROR_DESC_DATA_EMPTY, CommonConstants.ERROR_DESC_TEMPLATE_CATEGEORY_NOT_EXIST,
			CommonConstants.ERROR_DESC_DELETE_EXISTS_RELATED_DATA, CommonConstants.ERROR_DESC_REFUSE_SUPPLIER_IMPORT,
			CommonConstants.ERROR_DESC_FAIL_INTETION_COMPANY_IMPORT, CommonConstants.ERROR_DESC_UPDATE_RECORD_FAIL};
	
	public static final String ERROR_CODE_FAIL = "E_001";//调用失败
	public static final String ERROR_CODE_EXCEPTION = "E_002";//调用失败
	public static final String ERROR_CODE_DATA_NOT_EXISTEN = "E_003";//数据不存在
	public static final String ERROR_CODE_DATA_REQUEST = "E_004";//请求数据错误
	public static final String ERROR_CODE_DATA_EMPTY = "E_005";//请求数据为空
	public static final String ERROR_CODE_TEMPLATE_CATEGEORY_NOT_EXIST = "E_006";//供应商分类模版类型不存在
	public static final String ERROR_CODE_DELETE_EXISTS_RELATED_DATA = "E_007";//存在关联数据，不能删除
	public static final String ERROR_CODE_REFUSE_SUPPLIER_IMPORT = "E_008";//该供应商正被引入中，无法继续引入
	public static final String ERROR_CODE_FAIL_INTETION_COMPANY_IMPORT = "E_009";//意向地区公司引入出错
	public static final String ERROR_CODE_UPDATE_RECORD_FAIL = "E_010";//更新记录失败
	public static final String ERROR_CONTACT_STATUS_FAIL = "E_011";//合约未分配
	public static final String ERROR_NO_PURCHASE_CATEGEORY_CODE_FAIL = "E_012";//供应商分类流程编号不存在


	public static final String ERROR_DESC_FAIL = "调用失败";
	public static final String ERROR_DESC_DATA_NOT_EXISTEN = "数据不存在";
	public static final String ERROR_DESC_DATA_REQUEST = "请求数据错误";
	public static final String ERROR_DESC_DATA_EMPTY = "请求数据为空";
	public static final String ERROR_DESC_TEMPLATE_CATEGEORY_NOT_EXIST = "供应商分类模版类型不存在";
	public static final String ERROR_DESC_DELETE_EXISTS_RELATED_DATA = "存在关联数据，不能删除";
	public static final String ERROR_DESC_GET_DEFFERENT_PROJECT_DATA = "选择了不同的项目";
	public static final String ERROR_DESC_REFUSE_SUPPLIER_IMPORT = "该供应商正被引入中，无法继续引入";
	public static final String ERROR_DESC_FAIL_INTETION_COMPANY_IMPORT = "意向地区公司引入出错";
	public static final String ERROR_DESC_UPDATE_RECORD_FAIL = "更新记录失败";
	
	public static final String[] SUCCESS_CODES = {CommonConstants.SUCCESS_CODE_ADD, CommonConstants.SUCCESS_CODE_UPDATE,
				CommonConstants.SUCCESS_CODE_DEL, CommonConstants.SUCCESS_CODE_ACTIVITE,
				CommonConstants.SUCCESS_CODE_INACTIVITE, CommonConstants.SUCCESS_CODE_MODIFY};
	public static final String[] SUCCESS_DESCS = {CommonConstants.SUCCESS_DESC_ADD, CommonConstants.SUCCESS_DESC_UPDATE, 
				CommonConstants.SUCCESS_DESC_DEL, CommonConstants.SUCCESS_DESC_ACTIVITE,
				CommonConstants.SUCCESS_DESC_INACTIVITE, CommonConstants.SUCCESS_DESC_MODIFY};
	
	public static final String SUCCESS_CODE_ADD = "S_001";//新增成功
	public static final String SUCCESS_CODE_UPDATE = "S_002";//修改成功
	public static final String SUCCESS_CODE_DEL = "S_003";//删除成功
	public static final String SUCCESS_CODE_ACTIVITE = "S_004";//已启用
	public static final String SUCCESS_CODE_INACTIVITE = "S_005";//已停用
	public static final String SUCCESS_CODE_MODIFY = "S_006";//更新成功
	
	public static final String SUCCESS_DESC_ADD = "新增成功";
	public static final String SUCCESS_DESC_UPDATE = "修改成功";
	public static final String SUCCESS_DESC_DEL = "删除成功";
	public static final String SUCCESS_DESC_ACTIVITE = "已启用";
	public static final String SUCCESS_DESC_INACTIVITE = "已停用";
	public static final String SUCCESS_DESC_MODIFY = "更新成功";
	
	//供应商分类-模版类型
	public static final int TEMPLATE_CATEGORY_1 = 1; //现场考察
	public static final int TEMPLATE_CATEGORY_2 = 2; //履约过程评估
	public static final int TEMPLATE_CATEGORY_3 = 3; //履约后评估
	public static final int TEMPLATE_CATEGORY_4 = 4; //评分定级
	public static final int TEMPLATE_CATEGORY_5 = 5; //技术明标评分
	public static final int TEMPLATE_CATEGORY_6 = 6; //技术暗标评分
	public static final int TEMPLATE_CATEGORY_7 = 7; //项目经理面试评分
	
	//Home 显示参数设置
	public static final int NOTICE_SHOW_NUM = 5;

	public static final String TEMPLATE = "模版";
	
	//bpm常量
	public static final int BPM_STATUS_FAIL = 0;//bpm对接失败
	public static final int BPM_STATUS_SUCCESS = 1;//bpm对接成功
	public static final int BPM_ABUTMENT_TYPE_SUPPLIER = 1;//bpm对接类型-1：供应商，2：采购
	public static final int BPM_ABUTMENT_TYPE_PURCHASE = 2;//bpm对接类型-2：采购
	public static final int BPM_ABUTMENT_SUB_TYPE_SUPPLIER_STORAGE = 1;//bpm对接子类型-1：供应商入库审批

	/**
	 * 删除标记（0：正常；1：删除；）
	 */
	public static final int DEL_FLAG_NORMAL = 0;
	public static final int DEL_FLAG_DELETE = 1;

    public static String SUPPLIER_STATUS_UNQUALIFIED = "11,12,13";//不合格列表的状态
	public static String  SUPPLIER_STATUS_QUALIFIED = "8,9,10,11";//合格列表的状态
	public static String  SUPPLIER_STATUS_TO_VIEW = "7";//待观察列表的状态
	public static String  SUPPLIER_STATUS_BLACK = "13,14";//黑裤列表的状态
	public static String  SUPPLIER_STATUS_POTENTIAL = "1,2,3,4,5,6";//潜在列表的状态

	//是否主联系人（0：否，1：是）
	public static final int MAIN_CONTACTS = 1;
	public static final int COMMON_CONTACTS = 0;

	//合作类型（1：一般合作，2：战略合作）
	public static final int COMMON_COOPRATIVE = 1;
	public static final int MAJOR_COOPRATIVE = 2;

	//是否处理（0：否，1：是）
	public static final int UNDONG_FLAG = 0;
	public static final int DONG_FLAG = 1;

	//是否显示（0：否，1：是）
	public static final int SHOW_FLAG = 1;
	public static final int HIDDEN_FLAG = 0;
	
	//合作年数
	public static final int COOPERATION_YEARS = 2;

	//代办处理结果
	public static final int DEAL_BACK = 1;
	public static final int DEAL_OK = 2;

	//审批历史子状态
	public static final int HISTORY_SUB_TYPE_TASK = 1;
	public static final int HISTORY_SUB_TYPE_ASK = 2;

	//数据字典type
	public static final String SYS_DICT_TYPE_PURCHASE_STATUS_MAP="purchase_status_map";
	public static final String SYS_DICT_TYPE_CONTACT_STATUS_MBS_MAPPING="contact_status_mbs_mapping";
	public static final String SYS_DICT_TYPE_MBS_SYNS="mbs_syns";
	public static final String SYS_DICT_TYPE_RECOMMEND_TYPE = "recommender_type";
	public static final String SYS_DICT_VALUE_MBS_SUPPLIER_INTERNAL_PERFORMANCE="mbs_supplier_internal_performance";
	public static final String SYS_DICT_VALUE_MBS_STRATEGIC_PROTOCOL="mbs_strategic_protocol";

	//是否同意（1：不同意，2：同意）
	public static final int NO_AGREE_FLAG = 1;
	public static final int AGREE_FLAG = 2;

	//来源（0：外部，1：内部）
	public static final int INNER = 1;
	public static final int EXTERNAL = 0;
	//是否中标
	public static final int AWARD_BID_NOT = 0;
	public static final int AWARD_BID= 1;

	//流标状态
	public static final int ABORTIVE_BID_NOT = 0;
	public static final int ABORTIVE_BID_ING= 1;
	public static final int ABORTIVE_BID_OK= 2;

	//供应商回函情况
	public static final int SUPPLIER_RESPONSE_LETTER_YES = 2;
	public static final int SUPPLIER_RESPONSE_LETTER_NO = 1;

	//标合格情况
	public static final int BID_OK = 1;
	public static final int BID_NO = 0;

	//用户类型user_type 1 外网用户 2内网用户
	public static final int EXTERNAL_USER = 1;
	public static final int INNER_USER = 2;

	//消息模版状态
	public static final int MSG_TEMPLATE_OPEN =2;
	public static final int MSG_TEMPLATE_CLOSE=1;

	//会签通过情况
	public static final int COUNT_SIGN_PASS=2;
	public static final int COUNT_SIGN_NOT=1;
	
	//专项采购计划是否生成
	public static final int GENERATED_NO = 0;
	public static final int GENERATED_YES = 1;

	//招标项类型（1：专项，2：战略）
	public static final int PURCHASE_ITEM_TYPE_SPECIAL = 1;//1：专项
	public static final int PURCHASE_ITEM_TYPE_STRATEGY = 2;//2：战略

	//--------------redislock-----------------
	public static final String LOCK_SUCCESS = "OK";
	public static final String SET_IF_NOT_EXIST = "NX";
	public static final String SET_WITH_EXPIRE_TIME = "PX";
	public static final Long RELEASE_SUCCESS = 1L;

}
